GstRTMPMetadata Basics
The GstRTMPMetadata documentation from RidgeRun is presently being developed. |
RTMP and FLV Overview
RTMP (Real-Time Messaging Protocol) is a communication protocol designed for low-latency streaming of audio, video, and data over the Internet. Originally created by Macromedia, it is still widely used today as an ingest protocol by platforms like YouTube, Twitch, and Facebook Live.
RTMP uses the FLV (Flash Video) container format. An FLV stream consists of three main types of tags:
- Audio tags – contain encoded audio payloads (e.g., AAC).
- Video tags – contain encoded video payloads (e.g., H.264, H.265).
- Script Data tags – carry metadata objects encoded in AMF (Action Message Format). This is the mechanism used for the well-known onMetaData object, and it is also the path where we introduce custom metadata.
FLV Script Data Tags
Script Data tags allow embedding arbitrary key-value objects alongside audio and video. These objects can include stream information, timing, or user-defined metadata. Our implementation leverages these tags to carry binary or string metadata transparently.
Muxing and Demuxing in GStreamer
In GStreamer, FLV handling is split into two components:
- flvmux – packs audio, video, and metadata into FLV tags for streaming through sinks such as rtmpsink.
- flvdemux – unpacks FLV tags from sources such as rtmpsrc and distributes audio, video, and metadata to downstream elements.
The RidgeRun GstRTMPMetadata support extends both elements to handle arbitrary user metadata, providing seamless integration into GStreamer pipelines.
The GstRTMPMetadata
The RidgeRun work is provided as a set of patches to the existing GStreamer flvmux and flvdemux elements. These patches extend FLV support to allow insertion and extraction of arbitrary metadata.
Features in flvmux
- Property-based injection
* meta-string: Inserts metadata as a UTF-8 string directly into the stream. * meta-binary: Inserts metadata as a binary payload (GBytes).
- GstMeta-based injection
* If an upstream buffer contains a custom GstFlvMeta, flvmux will serialize it and inject it into the outgoing FLV stream.
Features in flvdemux
- Metadata extraction
* Parses Script Data tags from the FLV stream. * Creates the GstMeta with metadata extracted from the stream.
- Signaling support
* If the flv-meta-signal property is enabled, the element emits a flv-meta signal containing the metadata payload as GBytes. * Useful for applications that want immediate notification when metadata arrives.
- Attach to buffers
* With attach-flvmeta=true, metadata is embedded as a GstMeta in the first audio and video buffers after detection.
Supported GStreamer Versions
The patches are maintained for the following GStreamer releases:
- 1.16.x
- 1.20.x
- 1.24.x
Note: Choose the build and patch set that matches your target GStreamer version.
Evaluation and Licensing
- An evaluation version is available on request, please refer to Contact Us to get an evaluation binary.
- This ensures functionality can be validated before integration into commercial systems.
Summary of Benefits
- Adds missing metadata functionality to RTMP in GStreamer.
- Flexible injection mechanisms (properties, GstMeta).
- Robust extraction with optional signals for real-time processing.
- Multi-version support ensures portability across platforms (PC, Jetson, NXP, Qualcomm).
- Ready-to-use evaluation builds for demos and proof-of-concept.